<?php
    $user = $this->member;
   
?>

  <script  src="<?php  echo JS_PATH.'/jquery/validate/jquery.validate.pack.js';?>"></script>
  <script>
       

    $(document).ready(function(){

     $('#commentForm').validate({
        rules: {
            firstname: "required",
            lastname: "required",
            height: {
                required: true
            },
            weight: {
                required: true
            }
        },
        messages: {
            firstname: "Please enter your firstname",
            lastname: "Please enter your lastname",
            height: {
                required: 'please enter a value',
                number: 'please enter a valid number'
            },
            weight: {
                required: 'please enter a value',
                number: 'please enter a valid number'
            }
        }
    });
});
</script>

    <div class="blockcms">
        <h3 class="pink" style="padding-bottom:10px">
            Edit profile &raquo; <?=$this->username?>
        </h3>
        <style>
            #tableeditprofile td {text-align:left}
        </style>
        <form action="" method="post" id="commentForm">
                <center>
                    <table cellspacing="0" cellpadding="0" width="98%" id="tableeditprofile">
                        <tr>
                            <td>First Name</td>
                            <td><input  class="input uniform" type="text" name="firstname" id="firstname" value="<?=htmlspecialchars($user->FirstName)?>" class="required" /></td>
                        </tr>
                        <tr>
                            <td width="150">Last Name</td>
                            <td><input  class="input uniform" type="text" name="lastname" id="lastname" value="<?=htmlspecialchars($user->LastName)?>" class="required" /></td>
                        </tr>
                        <tr>
                            <td>Company</td>
                            <td><input class="input uniform" type="text" name="company" value="<?=htmlspecialchars($user->Company)?>"  /></td>
                        </tr>
                        <tr>
                            <td>Street</td>
                            <td><input  class="input uniform required" type="text" name="Street" value="<?=htmlspecialchars($user->Street)?>"  /></td>
                        </tr>
                        <tr>
                            <td>Street 2</td>
                            <td><input class="input uniform" type="text" name="Street2" value="<?=htmlspecialchars($user->Street2)?>"  /></td>
                        </tr>
                        <tr>
                            <td>City</td>
                            <td>
                                <input type="text" id="city" name="city" class="input uniform required" value="<?=htmlspecialchars($user['City'])?>">
                            </td>
                        </tr>
                        <tr>
                            <td>State</td>
                            <td>
                                <input type="text" id="State" name="state" class="input uniform required" value="<?=htmlspecialchars($user->State)?>">
                            </td>
                        </tr>
                        <tr>
                            <td>Postal Code</td>
                            <td>
                                <input type="text" id="zip" name="zip" class="input uniform required" value="<?=htmlspecialchars($user->Zip)?>">
                            </td>
                        </tr>
                        <tr>
                            <td>Country</td>
                            <td>
                                <select name="country" class="uniform required">
                                    <option value="">Country</option>
                                    <?php
                                        $rowcountry = $this->rowcountry;
                                        $country = $user->Country;
                                        foreach ($rowcountry as $value) {
                                            ?>
                                                <option value="<?=$value['country_code']?>" <?php if($value['country_code'] == $country) {echo " selected";}?>><?=$value['country_name']?></option>
                                            <?php
                                        }
                                    ?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>Day Phone</td>
                            <td>
                                <input type="text" id="Phone" name="Phone" class="input uniform required" value="<?=htmlspecialchars($user->Phone)?>">
                            </td>
                        </tr>
                        <tr>
                            <td>Evening Phone</td>
                            <td>
                                <input type="text" id="Phone2" name="Phone2" class="input uniform required" value="<?=htmlspecialchars($user->Phone2)?>">
                            </td>
                        </tr>
                        <tr>
                            <td>Fax</td>
                            <td>
                                <input type="text" id="Fax" name="Fax" class="input uniform required" value="<?=htmlspecialchars($user->Fax)?>">
                            </td>
                        </tr>
                        <!--<tr>
                            <td colspan="2">
                                <h3 class="pink" style="padding:10px 0px">
                                    Credit card
                                </h3>
                            </td>
                        </tr>
                        <tr>
                            <td>Credit Card Number</td>
                            <td>
                                <input type="text" id="CreditCard" name="CreditCard" class="input uniform required" value="<?=htmlspecialchars($user->CreditCard)?>">
                            </td>
                        </tr>
                        <tr>
                            <td>ExpDate</td>
                            <td>
                                <input type="text" id="ExpDate" name="ExpDate" class="input uniform required" value="<?=htmlspecialchars($user->ExpDate)?>">
                            </td>
                        </tr>
                        <tr>
                            <td>CCV</td>
                            <td>
                                <input type="text" id="CCV" name="CCV" class="input uniform required" value="<?=htmlspecialchars($user->CCV)?>">
                            </td>
                        </tr>-->
                        <tr>
                            <td colspan="2">
                                <input  type="submit" name="submit" class="uniform" value="Update" />
                                <input  type="reset" class="uniform" value="Reset" />
                            </td>
                        </tr>
                    </table>
                </center>
		</form>
    </div>
<style>
    .input {width:190px;}
</style>